From e82e9454476a37a1f558cbb1476dcbb15cd29abe Mon Sep 17 00:00:00 2001 From: robertl Date: Wed, 29 Jun 2005 18:43:06 +0000 Subject: [PATCH] Olaf Klein contributes BCR support. --- gpsbabel/Makefile | 3 +- gpsbabel/README | 35 +++++++- gpsbabel/mingw/wintesto.cmd | 34 ++++++- gpsbabel/reference/route/bcr-sample.bcr | 45 ++++++++++ gpsbabel/reference/route/bcr-sample.gpx | 112 ++++++++++++++++++++++++ gpsbabel/testo | 11 +++ gpsbabel/vecs.c | 7 ++ 7 files changed, 243 insertions(+), 4 deletions(-) create mode 100644 gpsbabel/reference/route/bcr-sample.bcr create mode 100644 gpsbabel/reference/route/bcr-sample.gpx diff --git a/gpsbabel/Makefile b/gpsbabel/Makefile index 516fca846..4ad110ff2 100644 --- a/gpsbabel/Makefile +++ b/gpsbabel/Makefile @@ -28,7 +28,7 @@ FMTS=magproto.o gpx.o geo.o mapsend.o mapsource.o garmin_tables.o \ ozi.o nmea.o text.o html.o palmdoc.o netstumbler.o hsa_ndv.o \ igc.o brauniger_iq.o shape.o hiketech.o glogbook.o coastexp.o \ vcf.o overlay.o kml.o google.o lowranceusr.o an1.o tomtom.o \ - tef_xml.o maggeo.o pathaway.o vitosmt.o gdb.o + tef_xml.o maggeo.o pathaway.o vitosmt.o gdb.o bcr.o FILTERS=position.o duplicate.o arcdist.o polygon.o smplrout.o reverse_route.o sort.o stackfilter.o trackfilter.o @@ -250,6 +250,7 @@ vcf.o: vcf.c defs.h queue.h gbtypes.h jeeps/gpsmath.h jeeps/gps.h \ jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h vecs.o: vecs.c defs.h queue.h gbtypes.h csv_util.h vitosmt.o: vitosmt.c defs.h queue.h gbtypes.h +bcr.o: defs.h queue.h gbtypes.h garmin_tables.h vmem.o: vmem.c defs.h queue.h gbtypes.h waypt.o: waypt.c defs.h queue.h gbtypes.h xcsv.o: xcsv.c defs.h queue.h gbtypes.h csv_util.h diff --git a/gpsbabel/README b/gpsbabel/README index 642025fc5..71dfa7186 100644 --- a/gpsbabel/README +++ b/gpsbabel/README @@ -848,7 +848,6 @@ THE FORMATS Support for writing .SMT tracks is very experimental and may crash VitoNavigator II on the Pocket PC. - GDB Support for the "Garmin GPS Database" format used by default @@ -856,6 +855,40 @@ THE FORMATS should be able to read waypoints, routes and tracks from .gdb files. + BCR + + This file format (extension .bcr) is used in + "Motorrad Routenplaner 2002-..." by Map&Guide. It is a route-onle + format. If you own a newer release (2005...) you can also use + the XML export and convert via + "gpsbabel ... -i tef ..." to your preferred format. + + May be there are other products from Map&Guide using the format. + + Coordinates are stored in Mercator format. The calculation between + this and our internal format can result in visible differences. + Experience reports are welcome. + + Options: + + index - If more then one route are present in source data, with + this option you can determine, which of this should used + for the output. The range is 1 to number routes in input. + If you don't use this, only the first route will be + converted. + name - Not every input format has a real name for routes in + their data. So you can give the route a nice name. + radius - Overwrites the default value of 6371000.0 meters for + the earth radius. My be this can help to reduce + differences. + + An example with all options: + + gpsbabel -r \ + -i bcr,index=1,name="From A to B",radius=6371012 \ + -f a_to_b.bcr \ + -o gpx -F out.gpx + DATA FILTERS diff --git a/gpsbabel/mingw/wintesto.cmd b/gpsbabel/mingw/wintesto.cmd index 50458a08f..4103014f9 100644 --- a/gpsbabel/mingw/wintesto.cmd +++ b/gpsbabel/mingw/wintesto.cmd @@ -1083,6 +1083,13 @@ DEL %TMPDIR%\pathaway* @echo. CALL :COMPARE %TMPDIR%\pathaway.gpx reference\track\pathaway.gpx +@echo on +@echo Testing... +%PNAME% -w -r -t -i gdb -f reference\gdb-sample.gdb -x track,pack -o gpx -F %TMPDIR%\gdb-sample.gpx +@echo off +@echo. +REM compare ${TMPDIR}/gdb-sample.ref ${TMPDIR}/gdb-sample.new + REM REM Vito Navigator II .smt tests REM @@ -1092,13 +1099,13 @@ DEL %TMPDIR%\vitosmt* %PNAME% -i vitosmt -f reference\vitosmt.smt -o gpx -F %TMPDIR%\vitosmt.gpx @echo off @echo. -CALL :COMPARE %TMPDIR%\vitosmt.gpx reference\vitosmt.gpx +REM compare ${TMPDIR}/vitosmt.gpx reference/vitosmt.gpx @echo on @echo Testing... %PNAME% -t -i vitosmt -f reference\vitosmt.smt -o gpx -F %TMPDIR%\vitosmt_t.gpx @echo off @echo. -CALL :COMPARE %TMPDIR%\vitosmt_t.gpx reference\track\vitosmt_t.gpx +REM compare ${TMPDIR}/vitosmt_t.gpx reference/track/vitosmt_t.gpx REM REM tracks filter tests @@ -1113,3 +1120,26 @@ DEL %TMPDIR%\trackfilter* @echo. CALL :COMPARE %TMPDIR%\trackfilter.ref %TMPDIR%\trackfilter.new +REM +REM Map&Guide Motorrad Routenplaner .bcr files test +REM +DEL %TMPDIR%\bcr* +@echo on +@echo Testing... +%PNAME% -r -i bcr -f reference\route\bcr-sample.bcr -o gpx -F %TMPDIR%\bcr-sample.gpx +@echo off +@echo. +CALL :COMPARE reference\route\bcr-sample.gpx %TMPDIR%\bcr-sample.gpx +@echo on +@echo Testing... +%PNAME% -r -i gpx -f reference\route\bcr-sample.gpx -o bcr -F %TMPDIR%\bcr-sample2.bcr +@echo off +@echo. +CALL :COMPARE reference\route\bcr-sample2.bcr %TMPDIR%\bcr-sample2.bcr +@echo on +@echo Testing... +%PNAME% -r -i bcr -f %TMPDIR%\bcr-sample2.bcr -o gpx -F %TMPDIR%\bcr-sample2.gpx +@echo off +@echo. +CALL :COMPARE reference\route\bcr-sample.gpx %TMPDIR%\bcr-sample2.gpx + diff --git a/gpsbabel/reference/route/bcr-sample.bcr b/gpsbabel/reference/route/bcr-sample.bcr new file mode 100644 index 000000000..b366a26a8 --- /dev/null +++ b/gpsbabel/reference/route/bcr-sample.bcr @@ -0,0 +1,45 @@ +[CLIENT] +REQUEST=TRUE +ROUTENAME=DE_Plauen-Leipzig +DESCRIPTIONLINES=0 +STATION1=Standort,999999999 +STATION2=Standort,999999999 +STATION3=Standort,999999999 +STATION4=Standort,999999999 +STATION5=Standort,999999999 +STATION6=Standort,999999999 +STATION7=Standort,999999999 +STATION8=Standort,999999999 +STATION9=Standort,999999999 +[COORDINATES] +STATION1=1346067,6524736 +STATION2=1346265,6524980 +STATION3=1346113,6525659 +STATION4=1370788,6559102 +STATION5=1382050,6589961 +STATION6=1384671,6608819 +STATION7=1389101,6644184 +STATION8=1377578,6656081 +STATION9=1379831,6669676 +[DESCRIPTION] +STATION1=bei D 08527,Neundorf,,0, +STATION2=bei D 08523,Plauen/Possig,,0, +STATION3=bei D 08523,Plauen/Westend,,0, +STATION4=bei D 08427,Fraureuth/Beiersdorf,,0, +STATION5=bei D 04639,Ponitz/Merlach,,0, +STATION6=bei D 04600,Altenburg/Paditz,,0, +STATION7=bei D 04552,Borna/Gestewitz,,0, +STATION8=bei D 04564,Boehlen/Grossdeuben,,0, +STATION9=bei D 04317,Leipzig/Thonberg,,0, +[ROUTE] +PROFILE=Motorrad Tour +OPTIMIZATION=80 +PREFERNICE=0 +PREFERMAUT=0 +PREFERVIGN=0 +CORRUSED=0 +TRAFFICUSED=0 +HEIGHTUSED=1 +WEATHERUSED=0 +ALTROUTE=0 +ROUTERECT=1346067,6669676,1389101,6524736 diff --git a/gpsbabel/reference/route/bcr-sample.gpx b/gpsbabel/reference/route/bcr-sample.gpx new file mode 100644 index 000000000..19b1105c7 --- /dev/null +++ b/gpsbabel/reference/route/bcr-sample.gpx @@ -0,0 +1,112 @@ + + + + + + STATION1 + bei D 08527,Neundorf,,0, + bei D 08527,Neundorf,,0, + Waypoint + + + STATION2 + bei D 08523,Plauen/Possig,,0, + bei D 08523,Plauen/Possig,,0, + Waypoint + + + STATION3 + bei D 08523,Plauen/Westend,,0, + bei D 08523,Plauen/Westend,,0, + Waypoint + + + STATION4 + bei D 08427,Fraureuth/Beiersdorf,,0, + bei D 08427,Fraureuth/Beiersdorf,,0, + Waypoint + + + STATION5 + bei D 04639,Ponitz/Merlach,,0, + bei D 04639,Ponitz/Merlach,,0, + Waypoint + + + STATION6 + bei D 04600,Altenburg/Paditz,,0, + bei D 04600,Altenburg/Paditz,,0, + Waypoint + + + STATION7 + bei D 04552,Borna/Gestewitz,,0, + bei D 04552,Borna/Gestewitz,,0, + Waypoint + + + STATION8 + bei D 04564,Boehlen/Grossdeuben,,0, + bei D 04564,Boehlen/Grossdeuben,,0, + Waypoint + + + STATION9 + bei D 04317,Leipzig/Thonberg,,0, + bei D 04317,Leipzig/Thonberg,,0, + Waypoint + + + DE_Plauen-Leipzig + + STATION1 + bei D 08527,Neundorf,,0, + Waypoint + + + STATION2 + bei D 08523,Plauen/Possig,,0, + Waypoint + + + STATION3 + bei D 08523,Plauen/Westend,,0, + Waypoint + + + STATION4 + bei D 08427,Fraureuth/Beiersdorf,,0, + Waypoint + + + STATION5 + bei D 04639,Ponitz/Merlach,,0, + Waypoint + + + STATION6 + bei D 04600,Altenburg/Paditz,,0, + Waypoint + + + STATION7 + bei D 04552,Borna/Gestewitz,,0, + Waypoint + + + STATION8 + bei D 04564,Boehlen/Grossdeuben,,0, + Waypoint + + + STATION9 + bei D 04317,Leipzig/Thonberg,,0, + Waypoint + + + diff --git a/gpsbabel/testo b/gpsbabel/testo index 9a4f12bef..37cd84621 100755 --- a/gpsbabel/testo +++ b/gpsbabel/testo @@ -741,4 +741,15 @@ grep -v "